package com.laowang.project.system.controller;

import com.laowang.framework.web.domain.AjaxResult;
import com.laowang.project.system.domain.Province;
import com.laowang.project.system.service.AddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Auther laowang
 * @Date 2021/6/24
 * @Description
 */
@Api(tags = "地址接口")
@RestController
public class AddressController {

    @Resource
    private AddressService addressService;

    @ApiOperation("获取所有的省市区")
    @RequestMapping(value = "/address/getProvinces" , method = { RequestMethod.GET})
    public AjaxResult getAccountDetailList(HttpServletRequest request , HttpServletResponse response , ModelMap model){

        List<Province> list = addressService.getProvinces();
        return AjaxResult.success("成功",list);

    }
}
